package cz.tpj.database.mesto;

import static org.junit.Assert.*;

import org.junit.Test;

import cz.tpj.database.obrazky.Obrazok;
import cz.tpj.util.ErrorDatabase;

public class CityTest {

	@Test
	public void testName() {
		City o1 = new City();
		
		try {
			o1.setName("name");
		} catch (ErrorDatabase e) {
			e.printStackTrace();
		}
		
		assertEquals("name", o1.getName());
	}

	@Test
	public void testId() {
		City o1 = new City();
		
		try {
			o1.setId("1");
		} catch (ErrorDatabase e) {
			e.printStackTrace();
		}
		
		assertEquals("1", o1.getId());
	}

	@Test
	public void testShortDescription() {
		City o1 = new City();
		
		try {
			o1.setshortDescription("short desc");
		} catch (ErrorDatabase e) {
			e.printStackTrace();
		}
		
		assertEquals("short desc", o1.getshortDescription());
	}

	@Test
	public void testLongDescription() {
		City o1 = new City();
		
		try {
			o1.setlongDescription("long desc");
		} catch (ErrorDatabase e) {
			e.printStackTrace();
		}
		
		assertEquals("long desc", o1.getlongDescription());	
	}

	@Test
	public void testZamestnanec() {
		City o1 = new City();
		
		try {
			o1.setZamestnanec("1");
		} catch (ErrorDatabase e) {
			e.printStackTrace();
		}
		
		assertEquals("1", o1.getZamestnanec());	
	}

	@Test
	public void testObrazky() {
		City o1 = new City();
		Obrazok o2 = new Obrazok();
		
		try {
			o1.setObrazky(o2);
		} catch (ErrorDatabase e) {
			e.printStackTrace();
		}
		
		assertEquals(o2, o1.getObrazky());		
	}

	@Test
	public void testMapyNazov() {
		City o1 = new City();

		try {
			o1.setMapyNazov("map name");
		} catch (ErrorDatabase e) {
			e.printStackTrace();
		}
		
		assertEquals("map name", o1.getMapyNazov());	
	}
}
